.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.app-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 窗口控制按钮样式 */
.window-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.window-control-button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.window-control-button:hover {
  opacity: 0.8;
}

.window-control-button.close {
  background-color: #ff5f57;
}

.window-control-button.minimize {
  background-color: #ffbd2e;
}

.window-control-button.maximize {
  background-color: #28ca42;
}

/* 响应式设计 */
@media (max-width: 900px) {
  .app-sidebar-collapsed {
    width: 60px !important;
  }
  
  .app-sidebar-collapsed .sidebar-text {
    display: none;
  }
  
  .app-sidebar-collapsed .sidebar-badge {
    display: none;
  }
}

@media (max-width: 768px) {
  .app {
    font-size: 12px;
  }
  
  .window-controls {
    gap: var(--spacing-xs);
  }
  
  .window-control-button {
    width: 10px;
    height: 10px;
  }
}

/* 高DPI支持 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .app {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 动画效果 */
.app-transition {
  transition: all var(--transition-normal) ease-in-out;
}

.app-transition-fast {
  transition: all var(--transition-fast) ease-in-out;
}

/* 加载状态 */
.app-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--color-background);
}

.app-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-border);
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 错误状态 */
.app-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--color-background);
  color: var(--color-text);
  padding: var(--spacing-lg);
}

.app-error-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--color-error);
}

.app-error-message {
  font-size: 16px;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-secondary);
}

.app-error-button {
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.app-error-button:hover {
  background-color: var(--color-primary);
  opacity: 0.8;
}

/* 拖拽状态 */
.app-dragging {
  opacity: 0.7;
}

.app-drag-over {
  background-color: var(--color-primary);
  opacity: 0.1;
}

/* 焦点状态 */
.app-focused {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.app-blurred {
  opacity: 0.9;
}

/* 全屏状态 */
.app-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
}

/* 打印样式 */
@media print {
  .app {
    background: white !important;
    color: black !important;
  }
  
  .window-controls,
  .app-sidebar {
    display: none !important;
  }
  
  .app-content {
    height: auto !important;
    overflow: visible !important;
  }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  .app,
  .app-transition,
  .app-transition-fast {
    transition: none !important;
  }
  
  .app-loading-spinner {
    animation: none !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .app {
    --color-border: #000000;
    --color-text: #000000;
    --color-background: #ffffff;
  }
  
  [data-theme="dark"] .app {
    --color-border: #ffffff;
    --color-text: #ffffff;
    --color-background: #000000;
  }
}